package org.example.task.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.example.task.validation.DueDateAfterStartValidator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {DueDateAfterStartValidator.class})
public @interface DueDateAfterStart {
    String message() default "截止时间必须晚于开始时间";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
    //开始时间字段名
    String startField() default "startTime";
    //截止时间字段名
    String dueField() default "dueDate";
}
